import { request } from '@/utils/request.js'

/**
 * 供应商流水--应付 API JS
 */

export default {

  /**
   * 获取供应商流水--应付分页列表
   * @returns
   */
  getList (params = {}) {
    return request({
      url: 'finance/supplierFee/index',
      method: 'get',
      params
    })
  },
  /**
   * 添加供应商流水--应付
   * @returns
   */
  save (data = {}) {
    return request({
      url: 'finance/supplierFee/save',
      method: 'post',
      data
    })
  },
  //批量添加
  saveBatch (id,data = {}) {
    return request({
      url: 'finance/supplierFee/saveBatch/'+id,
      method: 'post',
      data
    })
  },
  /**
   * 更新供应商流水--应付数据
   * @returns
   */
  update (data = {}) {
    return request({
      url: 'finance/supplierFee/update/' + data.id,
      method: 'put',
      data
    })
  },

  /**
   * 读取供应商流水--应付
   * @returns
   */
  read (id) {
    return request({
      url: 'finance/supplierFee/read/' + id,
      method: 'get',
    })
  },

  /**
   * 将供应商流水--应付删除，有软删除则移动到回收站
   * @returns
   */
  deletes (data) {
    return request({
      url: 'finance/supplierFee/delete',
      method: 'delete',
      data
    })
  },

  /**
   * 从回收站获取供应商流水--应付数据列表
   * @returns
   */
  getRecycleList (params = {}) {
    return request({
      url: 'finance/supplierFee/recycle',
      method: 'get',
      params
    })
  },

  /**
   * 恢复供应商流水--应付数据
   * @returns
   */
  recoverys (data) {
    return request({
      url: 'finance/supplierFee/recovery',
      method: 'put',
      data
    })
  },

  /**
   * 真实删除供应商流水--应付
   * @returns
   */
  realDeletes (data) {
    return request({
      url: 'finance/supplierFee/realDelete',
      method: 'delete',
      data
    })
  },

  /**
   * 更改供应商流水--应付数据
   * @returns
   */
  changeStatus (data = {}) {
    return request({
      url: 'finance/supplierFee/changeStatus',
      method: 'put',
      data
    })
  },

  /**
   * 供应商流水--应付导出
   * @returns
   */
  exportExcel (params = {}) {
    return request({
      url: 'finance/supplierFee/export',
      method: 'post',
      responseType: 'blob',
      params
    })
  },

  /**
   * 放入 账单
   * @returns
   */
  billIn (data = {}) {
    return request({
      url: 'finance/supplierFee/bill/in',
      method: 'post',
      data
    })
  },
  /**
   * 拿出 账单
   * @returns
   */
  billOut (data = {}) {
    return request({
      url: 'finance/supplierFee/bill/out',
      method: 'post',
      data
    })
  },
  /**
   * 通过审计
   * @returns
   */
  auditPass (data = {}) {
    return request({
      url: 'finance/supplierFee/audit/pass',
      method: 'post',
      data
    })
  },
  /**
   * 反审计
   * @returns
   */
  auditRefuse (data = {}) {
    return request({
      url: 'finance/supplierFee/audit/refuse',
      method: 'post',
      data
    })
  },

  costSharingWaybill (data = {}) {
    return request({
      url: 'document/waybill/costSharing',
      method: 'post',
      data
    })
  },
  costSharingDelivery (data = {}) {
    return request({
      url: 'warehouse/delivery/costSharing',
      method: 'post',
      data
    })
  },
}